package com.sky.controller.users;

import com.sky.dto.PointPageQueryDTO;
import com.sky.entity.Point;
import com.sky.result.PageResult;
import com.sky.result.Result;
import com.sky.service.PointService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/point")
@Api(tags = "穴位相关接口")
public class PointController {
    @Autowired
    private PointService pointService;
    @GetMapping("/getAll")
    @ApiOperation(value = "查询所有穴位接口")
    public List<Point> getAll(){
        List<Point> pointList = pointService.pointList();
        return pointList;
    }

    @GetMapping("/page")
    @ApiOperation(value = "穴位分页查询接口")
    public Result<PageResult> pageSelect(PointPageQueryDTO pointPageQueryDTO){
        PageResult pageResult=pointService.pageQuery(pointPageQueryDTO);
        return Result.success(pageResult);
    }


}
